﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Member_Master.Master" AutoEventWireup="true" CodeBehind="M_ChangePassword.aspx.cs" Inherits="WebApplication.M_ChangePassword" %>
<%@ Register TagPrefix="uc1" TagName="usermeg" Src="~/UserControl/M_UserMessageControl.ascx" %>
<%@ Register TagPrefix="uc1" TagName="maintab" Src="~/UserControl/M_MainTabControl.ascx" %>
<%--<%@ Register TagPrefix="uc1" TagName="usermeg" Src="~/UserControl/UserMessageControl.ascx" %>
<%@ Register TagPrefix="uc1" TagName="maintab" Src="~/UserControl/MainTabControl.ascx" %>
--%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="Media/Css/master2.css" rel="stylesheet" media="all"/>
<link href="Media/Css/PeterCss.css" rel="Stylesheet" media="all" />
<style type="text/css">
.cssClass1{ background-color:Red; color:Gray;}
.cssClass2{ background-color:Yellow; color:Gray;}
.cssClass3{ background-color:Green; color:Black;}
.cssClass4{ background-color:Blue; color:White;}
.cssClass5{ display:none;}
</style>
<script type="text/javascript">
    function GetInfo() {
        if ($("#ContentPlaceHolder2_lkBtnSave").hasClass("aspNetDisabled").toString() != "true") {
            $("#ContentPlaceHolder2_err").html("");
            if ($("#ContentPlaceHolder2_OldPassword").val() == "") {
                $("#msg").html("Please Enter the Old PassWord");
            }
            else {
                if ($("#ContentPlaceHolder2_NewPassword").val() == "") {
                    $("#msg").html("Please Enter New Password");
                }
                else {
                    if ($("#ContentPlaceHolder2_ComfirmWord").val() == "") {
                        $("#msg").html("");
                    }
                    else if ($("#ContentPlaceHolder2_NewPassword").val() == $("#ContentPlaceHolder2_ComfirmWord").val()) {
                        var Chaeck_A = document.getElementById("ContentPlaceHolder2_RegularExpressionValidator1").style.visibility;
                        var Chaeck_B = document.getElementById("ContentPlaceHolder2_CompareValidator1").style.visibility;
                        if (Chaeck_A == "visible") {
                            document.getElementById("newpass").style.color = "red";
                        } else if (Chaeck_B == "visible") {
                            $("#msg").html();
                        } else {
                            $("#msg").html("");
                            $("#ContentPlaceHolder2_err").html("Data being processed, please wait ...");
                        }
                    }
                }
            }
        }
        else {

            $("#ContentPlaceHolder2_err").html("You currently do not have permission to operate...");
        }
        var t = setTimeout(timeOut, 4000);
    }

    function timeOut() {
        $("#msg").html("");
        document.getElementById("newpass").style.color = "#cccccc";
    }

    function Quit() {
        $("#ContentPlaceHolder2_CompareValidator1").html("");
        $("#msg").html("Cancel your operation...");
        var t = setTimeout(timeOut, 2000);
    }

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="content-title">
        <h1>
            Membership Info</h1>
    </div>
    <input type="hidden" value="t4" id="pageName" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<asp:ScriptManager id="Manager" runat="server"></asp:ScriptManager>
<uc1:usermeg ID="usermeg" runat="server" ></uc1:usermeg> 

<div class="partWrap">
<uc1:maintab ID="maintab"  runat="server"/>	
    <div class="clear20"></div>
	
		<div class="productWrap" style="border:none;">
	<div class="productTitle"></div>
	<div class="CheckWrap">
    <asp:UpdatePanel ID="Panel1" runat="server">
     <ContentTemplate>
	 <table>
	  <tr>
	    <td>
		 <p class="upinput">Old Password</p>
         <%--<input type="password" class="input200" name="" value="" id="">--%>
            <asp:TextBox ID="OldPassword" runat="server" CssClass="input200" 
                TextMode="Password"></asp:TextBox><br/>
                
		    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ErrorMessage="*" ForeColor="Red" ControlToValidate="OldPassword" 
                ValidationGroup="GroupSave" ></asp:RequiredFieldValidator>
                
		</td>
	  </tr>
	  <tr><td class="tdh10"></td></tr>
	  <tr>
	    <td>
		  <p class="upinput">New Password</p>
		  <asp:TextBox ID="NewPassword" runat="server" CssClass="input200" 
                TextMode="Password"></asp:TextBox><br />
          <ajax:PasswordStrength ID="PS" runat="server" TargetControlID="NewPassword" 
          DisplayPosition="RightSide" 
          StrengthIndicatorType="Text" 
          PreferredPasswordLength="8" 
          PrefixText="Strength:" 
          TextStrengthDescriptions="Very Poor;Weak;Average;Strong"
          TextStrengthDescriptionStyles="cssClass1;cssClass2;cssClass3;cssClass4" 
          RequiresUpperAndLowerCaseCharacters="false"
          CalculationWeightings="50;15;15;20" 
          MinimumNumericCharacters="0" 
          MinimumSymbolCharacters="0">
          </ajax:PasswordStrength>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="NewPassword" ErrorMessage="*" ForeColor="Red" 
                ValidationGroup="GroupSave"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ControlToValidate="NewPassword" ErrorMessage="*" 
                ValidationExpression="^\w*([a-zA-Z]+\d+|\d+[a-zA-Z]+)\w*$" ForeColor="Red" 
                ValidationGroup="GroupSave"></asp:RegularExpressionValidator>
          <br/>
           <span id="newpass" style="color:#cccccc; font-style:italic">At least 6 characters, should be a combination of numerical number and alphabetic characters.</span>
           </td>
           </tr>
           <tr>
	    <td>
		  <p class="upinput">Comfirm New Password</p>
		  <asp:TextBox ID="ComfirmWord" runat="server" CssClass="input200" 
                TextMode="Password"></asp:TextBox><br/>
          <asp:CompareValidator ID="CompareValidator1" ControlToCompare="ComfirmWord" 
                ErrorMessage="Please Comfirm New Password" ForeColor="Red" 
                ControlToValidate="NewPassword" CultureInvariantValues="true" Operator="Equal" 
                runat="server" ValidationGroup="GroupSave"></asp:CompareValidator>
		</td>
	  </tr>
	</table>
	<div class="clear20"></div>
  	<table width="200" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="80">
				 <ul class="uibtn">
    	           <li><span>
                        <asp:LinkButton ID="lkBtnSave"  runat="server" onclick="btnSave_Click" 
                           OnClientClick="return GetInfo()" ValidationGroup="GroupSave">Save</asp:LinkButton>
                   </span></li>
	            </ul>
				</td>
				<td>
				 <ul class="uibtn">
    	          <li><span><asp:LinkButton ID="Quit" runat="server" onclick="Quit_Click" OnClientClick="return Quit()">Quit</asp:LinkButton></span></li>
	             </ul>
				</td>				
			  </tr>
			</table>	
            <p>
            <asp:Label ID="err" runat="server" CssClass="clsWarningMeg" ></asp:Label>
            </p>
          </ContentTemplate>
        </asp:UpdatePanel>
        <div id="msg" class="clsWarningMeg"></div>
</div><!--CheckWrap  end-->
</div><!--productWrap  end-->
    
</div><!--partWrap  end-->	

</asp:Content>
